import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/styles/index.scss' // 导入样式

import App from './App'
import router from './router'
import store from './store'

import i18n from './lang' // Internationalization
import './icons' // icon
import './errorLog' // error log
import './permission.js' // 初始化执行权限判定
import './mock' // simulation data
import "./instruction"  //自定义权限指令
import globalComponents from './globalComponents.js'
import * as filters from './filters' // global filters
import common from '@/utils/common.js';//引入公共js方法

Vue.prototype.common=common;
Vue.use(globalComponents)
Vue.use(Element, {
    size: 'small', // set element-ui default size
    i18n: (key, value) => i18n.t(key, value)
})

// register global utility filters.
Object.keys(filters).forEach(key => {
    Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

//导入api
import api from '@/api/index.js'
Vue.prototype.$api = api;

new Vue({
    el: '#app',
    router,
    store,
    i18n,
    render: h => h(App)
})